﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WI.CandidateManager.Business.Objects;
using WI.CandidateManager.Common.Data.Entities;

namespace CandidateManager.Areas.Coach.Controllers
{
    /// <summary>
    /// Controller for working with candidates.
    /// </summary>
    public class CandidatesController : CandidateManager.Controllers.AutorizeBaseController
    {
        /// <summary>
        /// Get list of Candidates.
        /// </summary>
        /// <returns>View with list of Candidates.</returns>
        [Authorize]
        public ActionResult List()
        {
            CandidateBO candidateBO = new CandidateBO();
            var candidates = candidateBO.GetCandidates();

            return View(candidates);
        }

        /// <summary>
        /// Get object of candidate for detail.
        /// </summary>
        /// <param name="CandidateId">Candidate id.</param>
        /// <returns>View with candidate's detail.</returns>
        [Authorize]
        public ActionResult Detail(long CandidateId)
        {
            CandidateBO candidateBO = new CandidateBO();
            var candidates = candidateBO.GetCandidates(CandidateId);

            return View(candidates.First());
        }

    }
}
